package com.example.service.impl.shangPinServiceImpl;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.example.dao.shangPinDao.JsProductDao;
import com.example.pojo.shangPinPojo.JsProduct;
import com.example.service.shangPinService.JsProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Service
public class JsProductServiceImpl implements JsProductService {
    @Autowired
    private JsProductDao jsProductDao;
    /**
     * @Author: 郭
     * @Date: 2022/12/7 11:08
     * @Param:
     * @Return: List<JsProduct>
     * 商品表中的全查数据
     */
    @Override
    public List<JsProduct> getAll() {
        return jsProductDao.getAll();
    }
    /**
     * @Author: 郭
     * @Date: 2022/12/7 11:08
     * @Param: productId
     * @Return: int
     * 商品表中的删除
     */
    @Override
    public int getDelete(int productId) {
        return jsProductDao.getDelete(productId);
    }
    /**
     * @Author: 郭
     * @Date: 2022/12/7 11:09
     * @Param:
     * @Return: int
     * 商品表中的总数据
     */
    @Override
    public int getCount() {
        return jsProductDao.getCount();
    }
    /**
     * @Author: 郭
     * @Date: 2022/12/7 11:10
     * @Param: productName、categroyId、productSate、productDescription
     * @Return: List<JsProduct>
     * 商品表中的模糊查
     */
    @Override
    public List<JsProduct> getDimSelect(String productName,
                                        int categroyId,
                                        int productSate,
                                        String productDescription) {
        List<JsProduct> dimSelect = jsProductDao.getDimSelect(
                productName,
                categroyId,
                productSate,
                productDescription);
        return dimSelect;
    }
    /**
     * @Author: 郭
     * @Date: 2022/12/7 11:11
     * @Param: categroyId、productName、productSate、currentpriceProduct、productCstatus、productDescription
     * @Return: List<JsProduct>
     * 商品表中的高级检索模糊查
     */
    @Override
    public List<JsProduct> getGaoJiSelect(int categroyId,
                                          String productName,
                                          int productSate,
                                          BigDecimal currentpriceProduct,
                                          int productCstatus,
                                          String productDescription) {
        List<JsProduct> gaoJiSelect = jsProductDao.getGaoJiSelect(
                categroyId,
                productName,
                productSate,
                currentpriceProduct,
                productCstatus,
                productDescription);
        return gaoJiSelect;
    }
    /**
     * @Author: 郭
     * @Date: 2022/12/7 11:09
     * @Param: jsProduct
     * @Return: int
     * 商品表中的修改
     */
    @Override
    public int  getUpdate(JsProduct jsProduct) {
        int update = jsProductDao.getUpdate(jsProduct);
        return update;
    }
    /**
     * @Author: 郭
     * @Date: 2022/12/7 11:12
     * @Param: jsProduct
     * @Return: int
     * 商品表中的添加
     */
    @Override
    public int getAddInsert(JsProduct jsProduct) {
        return jsProductDao.getAddInsert(jsProduct);
    }
}
